package com.bcfrj.shop.service.impl;

import com.bcfrj.shop.mapper.CartMapper;
import com.bcfrj.shop.pojo.Cart;
import com.bcfrj.shop.service.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.relational.core.sql.In;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CartServiceImpl implements CartService {
    @Autowired
    private CartMapper cartMapper;

    @Override
    public List<Cart> queryCartAll(String User_account) {
        // 查询购物车
        List<Cart> cartList = cartMapper.queryCartAll(User_account);
        return cartList;
    }

    @Override
    public Cart queryCartById(Integer id) {
        return null;
    }

    @Override
    public Integer insertCart(Cart cart) {
        Integer rows = cartMapper.insertCart(cart);
        return rows;
    }

    @Override
    public Integer updateCart(Cart cart) {
        return null;
    }

    @Override
    public Integer deleteCart(Integer id) {
        return cartMapper.deleteCart(id);
    }
}
